package Java.BlackHorse.Thread.waitANDnotify2;

import java.util.concurrent.ArrayBlockingQueue;

public class Foodie extends Thread{
    ArrayBlockingQueue<String> abq;
    public Foodie(ArrayBlockingQueue<String> abq){
        this.abq=abq;
    }
    @Override
    public void run() {
       while(true){
//           不断从阻塞队列中获取面条
           try {
               String food = abq.take();
               System.out.println("吃货吃了"+food);
           } catch (InterruptedException e) {
               throw new RuntimeException(e);
           }
       }
    }
}
